{extend name="default/template/base_index" /}


{block name="area_header"}
    <style type="text/css">
        .selected{

            background-color: #326196;
        }
    </style>
{/block}

{block name="area_body"}
    {include file="default/Widget/topbar" /}
    <div class="admin-main container-fluid">
        {include file="default/Widget/left" /}
        <div class="admin-main-content">
            {include file="default/Widget/breadcrumb" /}
            <!-- 过滤\查询按钮 -->

            <div class="filter-controls">
                <form action="{:url('Admin/Sku/index')}" class="memberForm form-inline" method="get">
                    <div class="form-group">
                        <label class="control-label">规格名称</label>
                        <div class="input-group">
                            <input class="form-control" value="{$name}" type="text" name="name" placeholder="请输入规格名称" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label"></label>
                        <div class="input-group">
                            <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>查询</button>
                        </div>
                    </div>
                </form>
            </div>

            <div class="text-center"><h4>规格管理</h4></div>

            <!-- 操作按钮 -->
            <div class="btn-controls">
                <a class="btn btn-primary btn-sm" href="{:url('Admin/Sku/add')}">
                    <i class="fa fa-plus"></i>{:L('BTN_ADD')}</a>
            </div>

            <table class="table table-striped table table-hover  table-condensed">
                <thead>
                <tr>
                    <th>
                        <input type="checkbox" class="selectall" onclick="myUtils.selectall(this,'.selectitem');" />
                    </th>
                    <th>
                        默认规格名
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                </thead>
                <tbody>
                {empty name="list"}
                    <tr>
                        <td colspan="3" class="text-center">{:L('NO_DATA')}</td>
                    </tr>
                    {else/}
                    {volist name="list" id="vo"}
                        <tr>
                            <td>
                                <input type="checkbox" value="{$vo.id}" name="ids[]" class="selectitem" /></td>
                            <td>
                                <a href="{:url('Admin/Skuvalue/index',array('sku_id'=>$vo['id'],'p'=>$p))}">{$vo.name}</a>
                            </td>

                            <td>

                                <a href="{:url('Admin/Sku/deleteCateRelation',array('id'=>$vo['id']))}" class="btn btn-sm btn-danger ajax-get confirm"><i class="fa fa-trash"></i>清理类目引用</a>



                                <a href="{:url('Admin/Sku/edit',array('id'=>$vo['id'] ))}" class="btn btn-sm btn-default"><i class="fa fa-edit"></i>编辑</a>

                                <a href="{:url('Admin/Sku/delete',array('id'=>$vo['id']))}" class="btn btn-sm btn-danger ajax-get confirm"><i class="fa fa-trash"></i>删除</a>

                            </td>
                        </tr>

                    {/volist}
                {/empty}
                </tbody>
            </table>
            <div>{$show}</div>
        </div>

    </div>
    <!-- END admin-main-content -->
    </div>
    <!-- END admin-main-->
{/block}

{block name="area_footer"}
{/block}